/**
 * 建筑用能=>损耗分析
 */
import { Component } from "react";
import { Row, Col } from "antd";
import { observer } from "mobx-react";
import Condition from "./compontents/Condition";
import LossAnalysisTable from "./compontents/Table/index";
import "./index.less";
export interface LossAnalysisProps {}

export interface LossAnalysisState {
  queryData: ConditionData;
}
export interface ConditionData {
  staCycle: string;
  name: string;
}
@observer
class LossAnalysis extends Component<LossAnalysisProps, LossAnalysisState> {
  state = {
    queryData: {
      staCycle: "",
      name: "",
    },
  };
  render() {
    return (
      <>
        <Row>
          <Col span={24} style={{ paddingBottom: 12 }}>
            <Condition
              onSubmit={(data: any) => {
                this.getCondition(data);
              }}
            />
          </Col>
          <Col span={24}>
            <LossAnalysisTable queryData={this.state.queryData} />
          </Col>
        </Row>
      </>
    );
  }

  /**回调 */
  getCondition(data: any) {
    this.setState({ queryData: data });
  }
}

export default LossAnalysis;
